import java.util.Stack;

/**
 * Created by xiebang
 * Description
 * User:小谢
 * Date:2022-01-06
 * Time:17:42
 */
public class TestDemo {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        System.out.println(stack.peek());//获取栈顶元素但是不删除
        System.out.println(stack.pop());//弹出栈顶元素,返回值是栈顶元素
        System.out.println(stack.empty());//判断是否为空
        System.out.println(stack.isEmpty());//继承vector的方法


    }
}
